/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package yudisium;

/**
 *
 * @author Win-7
 */
import java.util.ArrayList;
import javax.swing.table.AbstractTableModel;

public class PeriksaYudisiumTabelModel extends AbstractTableModel {

    String columNames[] = {"nama", "nim", "nomor_hp",  "prodi", "periode_bulan", "periode_tanggal"
    , "bebaspinjam_lab", "bebaspinjam_dosen" ,"bukti_kp"};
    private ArrayList<Mahasiswa> data;

    public PeriksaYudisiumTabelModel() {
    }

    public PeriksaYudisiumTabelModel(ArrayList<Mahasiswa> data) {
        this.data = data;
    }

    public int getRowCount() {
        return getData().size();
    }

    public int getColumnCount() {
        return columNames.length;
    }


    @Override
    public String getColumnName(int col) {
        return columNames[col];
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
        Mahasiswa temp = getData().get(rowIndex);
        if (columnIndex == 0) {
            return temp.getNama();
        } else if (columnIndex == 1) {
            return temp.getNim();
        } else if (columnIndex == 2) {
            return temp.getNope();
        } else if (columnIndex == 3) {
            return temp.getProdi();
       
        } else if (columnIndex == 4 ){
            return temp.getPeriode();
       
        } else if (columnIndex == 5 ){
            return temp.getTanggal();
       
        
        } else if (columnIndex == 6 ){
            return temp.getBebaspinjamLab();
        } else if (columnIndex == 7 ){
            return temp.getBebaspinjamDosen();
        } else {
            return temp.getLaporanKP();
        }
    }

    public ArrayList<Mahasiswa> getData() {
        return data;
    }

    public void setData(ArrayList<Mahasiswa> data) {
        this.data = data;
    }
}

